2026-09-22 · class-notes, a-plus, comptia, messer, networking, ipv4, ipv6, nat
Full class notes for Professor Messer A+ 220-1201 objective 2.6: IPv4 structure and binary, RFC 1918 private ranges and NAT, IPv6 notation and /64 prefixes.
Class notes · Professor Messer, CompTIA A+ 220-1201 Core 1 · Section 2, objective 2.6
Quick reference: the short version of this lesson is the IPv4 and IPv6 cheat sheet, part of Section 2 alongside the lessons on ports, wireless, network services, DNS, DHCP, VLANs and VPNs, and network devices.
By the end of these notes you should be able to:
Almost every network conversation you have ever had used IP version 4 (IPv4), and configuring IPv4 on a system is a core A+ skill. Its successor, IP version 6 (IPv6), does the same job, getting packets from one host to another, but its addresses look completely different and are configured differently. You need to know both, because most networks today run both side by side.
An IPv4 address is 32 bits: a string of 32 ones and zeros. Nobody wants to read 32 binary digits, so we split the address into four groups of 8 bits and write each group as a decimal number, separated by dots. This is dotted decimal notation, as in 192.168.1.131.
Each group of 8 bits is an octet (8 bits make one byte, so you will also hear "byte"). Four octets make 32 bits, or 4 bytes.
192 . 168 . 1 . 131
11000000 . 10101000 . 00000001 . 10000011
| 8 bits | | 8 bits | | 8 bits | | 8 bits |
|<--------------- 32 bits = 4 octets = 4 bytes -------------->|
Eight bits can hold 2 to the power 8, or 256, different values. Counting from zero, that is 0 to 255. So every octet in a valid IPv4 address is between 0 and 255, and an address such as 192.168.1.300 is simply invalid.
Each bit in an octet has a place value, doubling from right to left:
| Place value | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
|---|---|---|---|---|---|---|---|---|
| 192 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 |
| 168 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 0 |
| 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 |
| 131 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 1 |
Take 131 as an example. Work left to right, subtracting each place value that fits:
The result is 10000011. Doing the same for each octet gives 11000000.10101000.00000001.10000011, which is 32 bits in total.
To go the other way, add up the place values wherever there is a 1: for 10101000, that is 128 + 32 + 8 = 168.
To communicate across the public internet, every device needs a unique public IP address. One device might be 1.1.1.1 and talk to another at 2.2.2.2, but no two devices on the internet can share the same public address.
Thirty-two bits allow 2 to the power 32 combinations: 4,294,967,296, or about 4.29 billion addresses. That sounds a lot, but the lesson cites more than 20 billion internet-connected devices, and the number keeps growing. There are simply not enough IPv4 addresses for every device to have its own.
The world has handled this in two ways: by reusing private addresses behind NAT (section 4), and by building a new version of IP with vastly more addresses (section 5).
A company might have one link to the internet with one public IPv4 address, but hundreds or thousands of devices inside. Those inside devices use private addresses, which work only within the private network and are reused by millions of other private networks around the world. Network Address Translation (NAT) on the router translates between the private addresses inside and the public address outside.
Private addresses never consume any of the public pool, so a whole organisation, or a whole home, can go online through a single public address.
PRIVATE NETWORK (RFC 1918) THE INTERNET
192.168.1.10 --+
| +----------------------+
192.168.1.11 --+----->+ Router doing NAT +-----> 203.0.113.5
| | inside: 192.168.1.1 | (the only public
192.168.1.12 --+ +----------------------+ address used)
Hundreds of private hosts can share one public IPv4 address.
Note (beyond this lesson): when many hosts share one public address, the router tells their connections apart by rewriting the TCP and UDP port numbers as well as the addresses. This is called port address translation (PAT), NAT overload, or NAPT, and it is what almost every home router does.
The private ranges are defined in RFC 1918. RFCs (Requests for Comments) are the documents in which internet standards and practices are published.
Correction: the lesson calls RFC 1918 a worldwide standard. It is published as a Best Current Practice (BCP 5) rather than a formal internet standard, but in practice every network follows it.
| Range | CIDR | Addresses | Typical use |
|---|---|---|---|
| 10.0.0.0 to 10.255.255.255 | 10.0.0.0/8 | 16,777,216 | Large corporate networks |
| 172.16.0.0 to 172.31.255.255 | 172.16.0.0/12 | 1,048,576 | Medium-sized networks |
| 192.168.0.0 to 192.168.255.255 | 192.168.0.0/16 | 65,536 | Home and small office networks |
Even the smallest range holds 65,536 addresses, far more than any home needs.
Exam tip: the middle range is the one people get wrong. It runs from 172.16 to 172.31 only. An address such as 172.32.0.1 or 172.15.0.1 is public.
Classify each address by checking it against the three ranges.
| Address | Private? | Reason |
|---|---|---|
| 10.20.30.40 | Private | Anything starting 10 is in 10.0.0.0/8 |
| 172.20.1.5 | Private | Second octet 20 is between 16 and 31 |
| 172.32.0.1 | Public | Second octet 32 is just outside 16 to 31 |
| 192.168.100.1 | Private | Starts 192.168 |
| 192.169.0.1 | Public | 192.169 is not 192.168 |
| 1.1.1.1 | Public | Not in any private range |
The method is always the same: look at the first octet, then the second, and compare with the table. The first two octets settle every case.
Note (beyond this lesson): a few other ranges are not public either.
127.0.0.0/8is loopback,169.254.0.0/16is APIPA (a Windows machine gives itself one of these when DHCP fails), and100.64.0.0/10is shared address space that some internet providers use for carrier-grade NAT, meaning your router's "public" address may itself be behind another layer of NAT.
Running out of addresses was one of the main problems IPv6 was designed to solve, so it is far larger: 128 bits instead of 32. That gives 2 to the power 128 addresses, about 340 undecillion (340 followed by 36 zeros; the exact figure is 340,282,366,920,938,463,463,374,607,431,768,211,456).
Correction: the lesson divides this among about 6.8 billion people, which was the world's population around 2010. The UN-based estimate for 2026 is about 8.3 billion. That still leaves roughly 41 billion billion billion (about 4 x 10 to the power 28) addresses per person, so the point stands.
Writing 128 bits in dotted decimal would take sixteen numbers, so IPv6 uses hexadecimal instead. Each hex digit represents 4 bits. An IPv6 address is written as eight groups of four hex digits, separated by colons. Each group is therefore 16 bits (2 octets), and eight groups make 128 bits, or 16 bytes.
2001:0db8:0000 : 0001 : 5d18:0652:cffd:8f52
|<-- site prefix -->| |< subnet >| |<---- interface ID --->|
| 48 bits | | 16 bits | | 64 bits |
|<--- network prefix: 64 bits ---->|
Each group of four hex digits is 16 bits; eight groups make 128 bits.
A site given a /48 can number 65,536 separate /64 subnets.
The lesson shows the address fe80::5d18:652:cffd:8f52 alongside its full form, fe80:0000:0000:0000:5d18:0652:cffd:8f52. Two rules turn one into the other.
Note (beyond this lesson): the lesson shows both forms without stating the rules. They are:
- Drop leading zeros in any group:
0652becomes652, and0000becomes0.- Replace one run of consecutive all-zero groups with
::. You can only do this once in an address, otherwise nobody could tell how many zeros each::stands for. If there are two runs, the convention is to compress the longer one (or the first, if they are the same length).
Shortening 2001:0db8:0000:0000:0000:ff00:0042:8329:
2001:db8:0:0:0:ff00:42:8329.::: 2001:db8::ff00:42:8329.Choosing which run to compress in 2001:db8:0:1:0:0:0:1: there is a single zero group (the third) and a run of three (fifth to seventh). Compress the longer run: 2001:db8:0:1::1.
Expanding fe80::5d18:652:cffd:8f52:
fe80, 5d18, 652, cffd, 8f52. That is five.:: stands for three groups of zeros.fe80:0000:0000:0000:5d18:0652:cffd:8f52.These results were checked with a standard IPv6 library, which produces the same shortened forms.
Correction: the lesson presents
fe80::5d18:652:cffd:8f52as the kind of address that connects the world over the global internet. Any address startingfe80is link-local: it only works on the local network segment, and routers never forward it. Globally routable addresses come from a different range.
| Type | Prefix | Starts with | Reach |
|---|---|---|---|
| Global unicast | 2000::/3 |
2 or 3 |
The whole internet |
| Link-local | fe80::/10 |
fe80 |
This network segment only; every IPv6 interface has one |
| Loopback | ::1/128 |
::1 |
This host only |
Note (beyond this lesson): there are also unique local addresses in
fc00::/7(in practice, addresses startingfd), which play a role similar to IPv4's private ranges. The2001:db8::/32prefix used in the examples here is reserved for documentation, so it never appears on a real network.
Nobody memorises 2001:db8::ff00:42:8329. With IPv4, people often type addresses directly; with IPv6, you rely on DNS to turn names into addresses. The DNS record for an IPv6 address is the AAAA record, the counterpart of IPv4's A record (covered in the 2.4 DNS lesson).
An IPv6 address splits neatly in half. The first 64 bits are the network prefix, which identifies the network. The last 64 bits are the interface ID, which identifies the host on that network. So almost every IPv6 network is written with a /64 prefix length.
Correction: the lesson calls /64 "the default subnet mask". IPv6 does not use dotted subnet masks at all; it uses a prefix length written after a slash. It also says IPv6 does not need much subnetting. Organisations still subnet IPv6, but differently: a site is typically given a larger block such as a /48 and divides it into /64 networks, one per LAN or VLAN. What disappears is the IPv4 habit of squeezing subnets to fit a certain number of hosts, because every /64 is vast.
| IPv4 | IPv6 | |
|---|---|---|
| Length | 32 bits (4 bytes) | 128 bits (16 bytes) |
| Written as | Four decimal octets, dotted | Eight groups of four hex digits, colons |
| Example | 192.168.1.131 |
2001:db8::ff00:42:8329 |
| Total addresses | About 4.29 billion | About 340 undecillion |
| Network part shown by | Subnet mask or prefix, e.g. 255.255.255.0 = /24 |
Prefix length, usually /64 |
| Address shortage | Solved with private ranges and NAT | No shortage; NAT not normally used |
| Loopback | 127.0.0.1 |
::1 |
| Name lookup | A record | AAAA record |
In the real world: most machines have both. On Windows,
ipconfiglists an IPv4 address and subnet mask alongside at least a link-local IPv6 address (it may end in%and a number, the interface index).Get-NetIPAddressin PowerShell andip addron Linux show the same information.
2001:db8::1 and 2001:0db8:0:0:0:0:0:1 are the same address. Blocklists, detection rules and log searches that compare text can miss matches, so normalise addresses to the standard compressed form first.fe80:: addresses and talk IPv6 on the local segment. Monitoring that ignores IPv6 misses that traffic.::.fe80:: addresses are link-local only; global addresses start with 2 or 3; ::1 is loopback.| Term | Meaning |
|---|---|
| AAAA record | The DNS record that maps a name to an IPv6 address |
| Dotted decimal | IPv4 notation: four decimal numbers separated by dots |
| Global unicast address | A publicly routable IPv6 address, from 2000::/3 |
| Hexadecimal | Base-16 numbering, digits 0 to 9 and a to f; each digit is 4 bits |
| Interface ID | The last 64 bits of an IPv6 address, identifying the host |
| IPv4 | Internet Protocol version 4: 32-bit addresses |
| IPv6 | Internet Protocol version 6: 128-bit addresses |
| Link-local address | An IPv6 address in fe80::/10, usable only on the local segment |
| NAT | Network Address Translation: translating private addresses to a public one |
| Network prefix | The network part of an IPv6 address, usually the first 64 bits |
| Octet | A group of 8 bits; one of the four parts of an IPv4 address |
| Prefix length | The number of network bits, written after a slash, such as /64 |
| Private address | An address from the RFC 1918 ranges, not routed on the internet |
| Public address | A globally unique address that is routed on the internet |
| RFC | Request for Comments: the document series that publishes internet standards and practices |
| RFC 1918 | The document that defines the IPv4 private address ranges |
2001:0db8:0000:0000:0000:0000:0000:0001.fe80::1 to its full form.fe80 on a server and says it is the server's internet address. What is wrong?2001:db8::1. Drop leading zeros, then replace the zero run with ::.fe80:0000:0000:0000:0000:0000:0000:0001. The :: stands for six zero groups.